#include<bits/stdc++.h>
using namespace std;
#define maxsize 100

typedef char elemtype;
typedef struct 
{
    elemtype *base;
    int front,rear;
}cycq;

void initq(cycq *q)
{
    q->base = (elemtype*)malloc(maxsize*sizeof(elemtype));
    q->front = q->rear = 0;
}

void insert(cycq *q,elemtype e)
{
    if((q->rear+1)%maxsize==q->front)
        return;
    q->base[q->rear] = e;
    q->rear = (q->rear+1)%maxsize;
}

void delq(cycq *q,elemtype *e)
{
    if(q->rear ==q->front)
        return;
    *e =q->base[q->front];
    q->front = (q->front+1)%maxsize;
}
